package com.cxj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cxj.domain.Admin;
import com.cxj.mapper.AdminMapper;
import com.cxj.service.AdminService;
import com.cxj.vo.User;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 宋小帅和李小美的computer
 * @description 针对表【admin(用户信息表)】的数据库操作Service实现
 * @createDate 2025-01-12 19:02:01
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin>
        implements AdminService {

    @Resource
    private AdminMapper adminMapper;

    @Override
    public Boolean login(String userName, String passWord) {
        User user = adminMapper.login(userName, passWord);
        if (user != null) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public User SelectUserByUserName(String Name) {
        User user = adminMapper.selectUserByUserName(Name);
        return user;
    }

    @Override
    public String insertNewUser (String Name , String passWord , String userName) {
        Boolean r = adminMapper.insertNewUser(Name,passWord,userName);
        if (r) {
            return "注册成功！牛逼666";
        } else {
            return "注册失败！";
        }
    }
}




